package com.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.project.bean.MovieBean;
import com.project.mapper.IMovieMapper;
import com.project.service.IMovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class MovieServiceImpl implements IMovieService {
    @Autowired
    private IMovieMapper mapper;
    @Override
    public void add(MovieBean movieBean) {
        mapper.insert(movieBean);
    }

    @Override
    public List<MovieBean> findByName(String name) {
        QueryWrapper<MovieBean> qw = new QueryWrapper<>();
        qw.like("m_name",name);
        return mapper.selectList(qw);
    }


}
